#include "Individual.h"
#include "amr_main.h"
#include <iostream>
#include <ctime>

using namespace std;

int main(int argc, char *argv[])
{
	struct CommandLine Parameters;
	MyEngine Engine;

	// Get parameters from command line
	if (argc < 3)
	{
		cerr << "AMR run-time error:" << endl;
		cerr << "Usage: amr <NumLoci> <Fitness Function>" << endl;
		cerr << "Now exiting to system." << endl;
		exit (8);
	}
	else 
	{
		Parameters.NumLoci = atoi(argv[1]);
		Parameters.FitnessFunction = atoi(argv[2]);
	}

	// Seed tr1 random number generator
	Engine.seed((unsigned int)time(NULL));

	// Create an individual
	CIndividual individual(Parameters.NumLoci, Parameters.FitnessFunction); 

	// Do something with the individual
	individual.PrintGenotype();
	individual.CalculateFitness(Parameters.FitnessFunction);
	individual.PrintFitness();
	individual.MakeGamete(Engine);
	individual.PrintGamete();

	return (0);
}